POV-Ray : Newsgroups : povray.general : normals and textures using texture_map : normals and textures using texture_map Server Time
28 May 2024 19:51:50 EDT (-0400)
  normals and textures using texture_map  
From: Ross
Date: 1 Jul 2005 17:54:37
Message: <42c5bb9d@news.povray.org>
I have a normal "myNormal", created from a pigment function "fnPig" that I
want to apply to a texture "t3", but i want to apply the normal after I'm
done doing the warp & scale loop. "t3" is a texture created with a
"texture_map" of two textures "t1" and "t2".

Is it possible to apply a normal on "t3" (see comment in "t3") without
specifying a normal on "t1" and "t2"? If so, how?

thanks,
ross

// Begin Pov SDL

#declare t1 = texture {pigment {rgb 1} finish { specular 1 roughness 0.003
diffuse 0.3 reflection {0.2, 0.4 fresnel on} } }
#declare t2 = texture {pigment {rgb 0.2} finish { specular 0.6 roughness
0.03 diffuse 0.3 } }

#declare nPig =
pigment {
 leopard scale 0.15
 color_map {
  [0.0 rgb 1]
  [1.0 rgb 0]
 }
 #declare step = 8;
 #declare turb = <0.34, 0.3, 0.7>;
 #while (step > 0)
  warp {repeat x flip y}
  warp {turbulence turb }
  scale 1.2
  #declare step = step - 1;
 #end
}

#declare fnPig = function {pigment {nPig}}
#declare myNormal = normal {function {fnPig(x, y, z).gray}}

#declare t3 =
 texture {
  leopard scale 0.15
  texture_map {
   [0.0 t1]
   [1.0 t2]
  }
  #declare w1 = 8;
  #declare t1 = <0.34, 0.3, 0.7>;
  #while (w1 > 0)
   warp {repeat x flip y}
   warp {turbulence t1 }
   scale 1.2
   #declare w1 = w1 - 1;
  #end
  // want to apply normal here, but it doesn't work
 }

/**** test scene ****/
camera {
  right x*image_width/image_height
  location  <0, 6, -10>
  look_at   <0,5,0>
}
sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}
light_source {
  <200,400,-350>
  color rgb 1
}
sphere {
 <0, 2, 2>, 2
 texture {t3}
 interior {
   ior 1.455
 }
}
plane {
  y, 0
  texture { pigment {rgb <0.65, 1, 0.36>} }
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.